//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __ELASTOS_8254_H__
#define __ELASTOS_8254_H__

enum {
    PIT_ClockRate               = 1193180,                      // unit: HZ
    PIT_ClockCycle              = (1000000000 / PIT_ClockRate), // unit: NS
};

enum {
    PIT_Irq                     = 0,
};

enum {
    Counter0_Port               = 0x40,
    Counter1_Port               = 0x41,
    Counter2_Port               = 0x42,
    Control_Port                = 0x43,
};

enum {
    ControlWord_BCD             = __8BIT(0),
    ControlWord_Mode0           = (0x00),
    ControlWord_Mode1           = (0x02),
    ControlWord_Mode2           = (0x04),
    ControlWord_Mode3           = (0x06),
    ControlWord_Mode4           = (0x08),
    ControlWord_Mode5           = (0x0a),
    ControlWord_Latch           = (0x00),
    ControlWord_RWLByte         = (0x10),
    ControlWord_RWHByte         = (0x20),
    ControlWord_RWBytes         = (0x30),
    ControlWord_SelectCounter0  = (0x00),
    ControlWord_SelectCounter1  = (0x40),
    ControlWord_SelectCounter2  = (0x80),
    ControlWord_ReadBack        = (0xc0),
};

#endif // __ELASTOS_8254_H__
